package particle;

import processing.core.PApplet;

public class Circle extends Shape {

	// Inherits all instance variables from parent
	// We add one more field here, color
	// color c;
	// Circle(float x_, float y_, float r_, color c_) {

	PApplet parent; // The parent PApplet that we will render ourselves onto

	public Circle(PApplet p, float x_, float y_, float r_) {

		super(p, x_, y_, r_); // Call the parent constructor
		// c = c_; // Also deal with this new instance variable

		parent = p;
	}

	public void jiggle() {
		// Call the parent jiggle
		super.jiggle();
		// Add some additional functionality
		r += random(-1, 1);
		r = constrain(r, 0, 100);
	}

	// An additional method to render the shape
	public void render() {
		parent.ellipseMode(CENTER);
		// fill(c);
		parent.stroke(0);
		parent.ellipse(x, y, r, r);
	}
}
